#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

#define FOR(i,a,n) for(int i=a,_n(n);i<_n;++i)
#define REP(i,n) FOR(i,0,n)

const int INF = 1<<29;

using namespace std;

struct Ans
{
    int ct4,ct7;
    int s;
    Ans(int a,int b)
    {
        ct4 = a, ct7 = b;
        s = a + b;
    }
    bool operator < (Ans ab) const
    {
        if(s!=ab.s) return s<ab.s;
        else
        {
            if(ct4!=ab.ct4) return ct4 < ab.ct4;
            else return ct7 < ab.ct7;
        }
    }
    void Print()
    {
        string s;
        REP(i,ct4) s+='4';
        REP(i,ct7) s+='7';
        cout<<s<<endl;
    }
};

int main()
{
    int n;
    while(cin>>n)
    {
        vector<Ans> v;
        REP(i,n/4+1)
        {
            int t = n - (i*4);
            if(t%7==0) v.push_back(Ans(i,t/7));
        }
        if(v.empty()) puts("-1");
        else
        {
            sort(v.begin(),v.end());
            v[0].Print();
        }
    }
    return 0;
}
